import React, { Component } from 'react'

type Props = {
    user: {
        username: string,
        age: number
    },
    // addAgeFn: () => void
    addAgeFn(): void
}

type State = {}

export default class Son extends Component<Props, State> {
    state = {}

    render() {
        return (
            <div>
                <p onClick={() => {
                    this.props.addAgeFn()
                }}>{this.props.user.username}--{this.props.user.age}</p>
            </div>
        )
    }
}